package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author itcast
 */
@RestController("workerWorkerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 服务提交认证相关接口")
public class WorkerCertificationAuditController {

    @Resource
    private IWorkerCertificationAuditService workerCertificationAuditService;

    /**
     * 4.2.1.1 服务端提交认证申请
     */
    @PostMapping
    @ApiOperation("服务端提交认证申请")
    public void add(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationAuditService.addWorkerCertification(workerCertificationAuditAddReqDTO);
    }

    /**
     * 4.2.1.2 查询最新的驳回原因
     */
    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public Map<String, String> queryRejectReason() {
        return workerCertificationAuditService.queryRejectReason();
    }

}
